import React from 'react';
import { Redirect } from 'umi';

/**
 * 权限校验
 */
export default (props: { children: React.ReactNode }) => {
  const { isLogin } = { isLogin: true };
  if (isLogin) {
    return <div>{props.children}</div>;
  } else {
    return <Redirect to="/login" />;
  }
};
